var playersModule = angular.module('playersModule', []);
playersModule.controller('playersController', function($scope,$http,$location) {
    $scope.getPlayersList = function () {
        $http.get(httpUrl+"/players/list", {
            headers: {
                'Content-Type': 'application/json; charset=UTF-8'
            }
        }).success(function (data, status, headers, config) {
            if (data.status == 200) {
                $scope.playersList = data.result;
            }
            else
            {
                alert(data.result);
            }
            //location.path('/login');
        }).error(function (data, status, headers, config) {
            alert("error!")
            //location.path('/register.html');
        });
    };
    $scope.getPlayersList();
});
